package com.csw.mysqldate.jdbctemplete;

import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;



@Configuration
public class DataSourceConfig {



    @Bean
    @ConfigurationProperties(prefix = "spring.datasource")
    DruidDataSource masterDataSource(){
        // DataSourceBuilder.create().build();
        return DruidDataSourceBuilder.create().build();
    }

//    @Bean
//    @ConfigurationProperties(prefix = "spring.datasource.slave")
//    DruidDataSource slaveDataSource(){
//        return DruidDataSourceBuilder.create().build();
//    }

}
/*————————————————
        版权声明：本文为CSDN博主「杨小格子」的原创文章，遵循CC 4.0 BY-SA版权协议，转载请附上原文出处链接及本声明。
        原文链接：https://blog.csdn.net/Simple_Yangger/article/details/100422819*/
